package com.school.information.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.information.entity.SysUserRoleEntity;
import com.school.information.mapper.SysUserRoleMapper;
import com.school.information.service.SysUserRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (SysUserRole)表服务实现类
 *
 * @author ycc
 * @since 2023-05-28 23:25:52
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRoleEntity> implements SysUserRoleService {

    @Override
    public List<SysUserRoleEntity> findByUserId(Long userId) {
        return baseMapper.selectList(Wrappers.<SysUserRoleEntity>query().lambda().eq(SysUserRoleEntity::getUserId, userId));
    }

    @Override
    public void delByUserId(Long userId) {
        this.remove(Wrappers.<SysUserRoleEntity>query().lambda().eq(SysUserRoleEntity::getUserId, userId));
    }
}
